package com.group.project.hrms.config;

import com.group.project.hrms.utils.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.aliyun.teaopenapi.models.*;

@Configuration
public class BeanConfig {


    /**
     * 将钉钉SDK中的客户端实例注入Spring容器中
     * @return
     * @throws Exception
     */
    @Bean
    public com.aliyun.dingtalkoauth2_1_0.Client createClient() throws Exception {
        Config config = new Config();
        config.protocol = "https";
        config.regionId = "central";
        return new com.aliyun.dingtalkoauth2_1_0.Client(config);
    }

    /**
     * 将工具包中的钉钉访问工具实例注入Spring容器中
     * @return
     */
    @Bean
    public DingAccessUtils createDingAccessUtils() {
        return new DingAccessUtils();
    }


    /**
     * 将工具包中的DingAPIURLs实例注入Spring容器中，该类为URL常量类
     * @return
     */
    @Bean
    public DingAPIURLs createDingAPIURLs(){
        return new DingAPIURLs();
    }

    /**
     * 将ProgressUtil实例注入Spring容器中
     * @return
     */
    @Bean
    public ProgressUtil createProgressUtil(){
        return new ProgressUtil();
    }

    /**
     * 将BasicInfoUtil实例注入到String容器中
     * @return
     */
    @Bean
    public BasicInfoUtil createBasicInfoUtil(){
        return new BasicInfoUtil();
    }

    /**
     * 将DateUtil实例注入到Spring容器中
     * @return
     */
    @Bean
    public DateUtil createDateUtil(){
        return new DateUtil();
    }

    /**
     * 将验证工具集对象注入到Spring容器中
     * @return
     */
    @Bean
    public VerificationUtil createVerificationUtil(){
        return new VerificationUtil();
    }

    /**
     * 将考勤计算工具类注入Spring容器中
     * @return
     */
    @Bean
    public AttendanceUtil createAttendanceUtil(){
        return new AttendanceUtil();
    }


    /**
     * 将薪资计算的工具类注入Spring容器中
     * @return
     */
    @Bean
    public SalaryUtil createSalaryUtil(){
        return new SalaryUtil();
    }


    /**
     * 将系统操作日志记录对象注入Spring容器中
     * @return
     */
    @Bean
    public LogUtil createLogUtil(){
        return new LogUtil();
    }


}
